#!/bin/bash

if [ $# != 2 ]; then
    echo "Usage: bash inference.sh <om_path> <batch_size>"
    echo "[ERROR] Invalid arguments: $@"
    exit 1
fi

set -e

om_path=$1
bs=$2
bin_data_dir=./data/bert_bin

echo -e "\inference..."
python -m ais_bench \
    --model ${om_path} \
    --input ${bin_data_dir}/input_ids,${bin_data_dir}/input_mask,${bin_data_dir}/segment_ids \
    --output ./results \
    --output_dirname bs${bs} \
    --batchsize ${bs}

echo -e "\ndone. inference results saved in ./results/bs${bs}/"
